﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _25_interface
{
    class Program
    {
        //什么时候用虚方法
        //什么时候用抽象类
        //什么时候用接口实现多态
        static void Main(string[] args)
        {
            ISwiming swim = new RealDuck();
            swim.swim();

            Console.ReadKey();

        }

        //真的鸭子会游泳，  木头鸭子不会游泳 ， 橡皮鸭子会游泳

        public interface ISwiming
        {
            void swim();
        }

        public class RealDuck : ISwiming
        {
            public void swim()
            {
                Console.WriteLine("真的鸭子游泳");
            }
        }

        public class XPDuck : ISwiming
        {
            public void swim()
            {
                Console.WriteLine("橡皮鸭子游泳");
            }
        }

        public class MuDuck
        {

        }

    }
}
